package com.zilue.payment.gateway.paramter;

public class ParameterCheckResult {
    private boolean status;
    private String name;
    private String description;

    public static ParameterCheckResult createErrorResult(String name, String description) {
        return new ParameterCheckResult(false, name, description);
    }

    public static ParameterCheckResult createSuccess() {
        return new ParameterCheckResult(true, null, "参数校验合法");
    }

    private ParameterCheckResult(boolean status, String name, String description) {
        this.status = status;
        this.name = name;
        if (!status) {
            this.description = "参数不合法！ 参数：" + name + " 规则：" + description;
        } else {
            this.description = description;
        }
    }

    public boolean isStatus() {
        return status;
    }

    public String getName() {
        return name;
    }

    public String getDescription() {

        return description;
    }

    @Override
    public String toString() {
        return "ParameterCheckResult{" +
                "status=" + status +
                ", description='" + description + '\'' +
                '}';
    }
}
